package org.jeecg.modules.wms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 成品入库单表
 */
@Data
@TableName("wms_finished_goods_inbound")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "FinishedGoodsInbound", description = "成品入库单")
public class FinishedGoodsInbound implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键ID")
    private String id;

    /**
     * 入库单号
     */
    @Excel(name = "入库单号", width = 15)
    @ApiModelProperty(value = "入库单号")
    private String inboundNo;

    /**
     * 销售订单ID
     */
    @Excel(name = "销售订单ID", width = 15)
    @ApiModelProperty(value = "销售订单ID")
    private String orderId;

    /**
     * 销售订单号
     */
    @Excel(name = "销售订单号", width = 15)
    @ApiModelProperty(value = "销售订单号")
    private String orderNo;

    /**
     * 生产计划ID
     */
    @Excel(name = "生产计划ID", width = 15)
    @ApiModelProperty(value = "生产计划ID")
    private String productionPlanId;

    /**
     * 生产任务ID
     */
    @Excel(name = "生产任务ID", width = 15)
    @ApiModelProperty(value = "生产任务ID")
    private String productionTaskId;

    /**
     * 入库日期
     */
    @Excel(name = "入库日期", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "入库日期")
    private Date inboundDate;

    /**
     * 仓库ID
     */
    @Excel(name = "仓库ID", width = 15)
    @ApiModelProperty(value = "仓库ID")
    private String warehouseId;

    /**
     * 总入库数量
     */
    @Excel(name = "总入库数量", width = 15)
    @ApiModelProperty(value = "总入库数量")
    private Integer totalQuantity;

    /**
     * 入库状态：0-待入库，1-部分入库，2-已完成
     */
    @Excel(name = "入库状态", width = 15, dicCode = "finished_goods_inbound_status")
    @Dict(dicCode = "finished_goods_inbound_status")
    @ApiModelProperty(value = "入库状态：0-待入库，1-部分入库，2-已完成")
    private Integer inboundStatus;

    /**
     * 操作员ID
     */
    @Excel(name = "操作员ID", width = 15)
    @ApiModelProperty(value = "操作员ID")
    private String operatorId;

    /**
     * 操作员姓名
     */
    @Excel(name = "操作员姓名", width = 15)
    @ApiModelProperty(value = "操作员姓名")
    private String operatorName;

    /**
     * 备注
     */
    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 租户ID
     */
    @ApiModelProperty(value = "租户ID")
    private Integer tenantId;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createBy;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    /**
     * 删除标识：0-正常，1-已删除
     */
    @ApiModelProperty(value = "删除标识：0-正常，1-已删除")
    private Integer delFlag;

    // 扩展字段，用于前端展示
    /**
     * 仓库名称
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "仓库名称")
    private String warehouseName;

    /**
     * 客户名称
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "客户名称")
    private String customerName;

    /**
     * 项目名称
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "项目名称")
    private String projectName;

    /**
     * 入库明细列表
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "入库明细列表")
    private List<FinishedGoodsInboundDetail> detailList;
}
